<script type="text/javascript" src="tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
	tinyMCE.init({
		// General options
		mode : "exact", // mặc định mode : "textareas", nếu sử dụng mặc định bỏ dòng elements bên dưới
		elements : "noidung", // cái này là tùy chỉnh của bạn , nhận tất cả các textarea có id là textarea_full
		theme : "advanced",
		skin : "o2k7",
        skin_variant : "silver",
		plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",

		// Theme options
		theme_advanced_buttons1 : "save,newdocument,cleanup,code,|,tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,insertdate,inserttime,charmap,advhr,",
		theme_advanced_buttons2 : "bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,|,cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,emotions,iespell,media,link,unlink,anchor,image,",
		theme_advanced_buttons3 : "styleselect,formatselect,fontselect,fontsizeselect,|,forecolor,backcolor,|,print,|,ltr,rtl,|,preview,fullscreen",
		
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,

		// Example content CSS (should be your site CSS)
		content_css : "css/content.css",

		// Drop lists for link/image/media/template dialogs
		template_external_list_url : "lists/template_list.js",
		external_link_list_url : "lists/link_list.js",
		external_image_list_url : "lists/image_list.js",
		media_external_list_url : "lists/media_list.js",

		// Style formats
		style_formats : [
			{title : 'Bold text', inline : 'b'},
			{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
			{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
			{title : 'Example 1', inline : 'span', classes : 'example1'},
			{title : 'Example 2', inline : 'span', classes : 'example2'},
			{title : 'Table styles'},
			{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
		],

		// Replace values for the template plugin
		template_replace_values : {
			username : "Some User",
			staffid : "991234"
		}
	});
	
	function check()
	{
		re=/^\s*$/;
		if(re.test(formsua.tieude.value))
		{
			alert("Tiêu đề không được để trống");
			return false;
		}
	}
	function deleteImage() {
		document.getElementById("tenanh").setAttribute("value"," ");
		document.getElementById("anh").style.display = "none";
	}

</script>
<!-- /TinyMCE -->

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <div id="table"> 
     <?
	$id=$_REQUEST["id"];
	$sql="select * from thongtingiaovien where idthongtingiaovien = $id";
	$result=mysql_query($sql) or die("Can not query thongtingiaovien in edit.php");
	while ($row=mysql_fetch_array($result))
	{
?>


<form name="formsua" method="post" action="?go=thongtingiaovien&action=edit&id=<?=$id?>" onsubmit="return check();" enctype="multipart/form-data"  >
		<table cellpadding="0" cellspacing="0" border="1" align="center" width="100%">
			<tr>
				<td width="20%" align="right" style="padding-right:5px"> Tiêu đề </td>
				<td width="80%" style="padding-left:5px;"> <input type="text" name="tieude" value="<?=$row['tieude']?>" style="width:70%"> </td>
			</tr>
            <tr>
            	<td> Tóm tắt </td>
                <td> <textarea name="tomtat" cols="60" rows="5"><?=$row["tomtat"]?></textarea></td>
            </tr>
            <tr>
				<td align="right" style="padding-right:5px">Ảnh  </td>
     			<td style="padding-left:5px;"><input type="file" name="image" title="Định dạng file JPEG,JPG,BMP,PNG,GIF. Kích thước tối đa 300KB"></td>
			</tr>
            <tr>
            	<td></td>
                <td><img id="anh" src="../img/thongtingiaovien/<?=$row["anhpreview"]?>"  height="50%" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100"
onmouseout="this.style.opacity=0.6;this.filters.alpha.opacity=60" style="opacity:0.6;filter:alpha(opacity=60)" /></td>
            </tr>
            <tr>
            	<td></td>
                <td><input type="text" id="tenanh" name="tenanh" value="<?=$row["anhpreview"]?>" readonly="readonly" /></td>
            </tr>
            <tr>
            	<td></td>
            	<td style="padding-left:5px;"><input type="button" value="Xóa File Ảnh" name="xoafile" onclick="if (confirm('Bạn muốn xóa file ?') == true) 	{             
                	deleteImage(); 
                } else {
                	return false;
                }" /></td>
            </tr>
			<tr>
      			<td align="right" style="padding-right:5px">Trạng thái: </td>
      			<td style="padding-left:5px">
        			<select name="trangthai">
					<?
						if($row['status']==1)
						{
					?>
						<option value="1" selected="selected">Hoạt động</option>
						<option value="0">Không hoạt động</option>
					<?
						}
						else
						{
					?>
						<option value="1">Hoạt động</option>
						<option value="0" selected="selected">Không hoạt động</option>		
					<?
						}
					?>
       			 </select>
      			</td>
    		</tr>
            <tr>
            	<td align="right" style="padding-right:5px"> Nội dung </td>
	            <td><textarea name="noidung" id="noidung" rows="40" cols="80" style="width: 100%"> <? echo $row["noidung"];?></textarea></td>
            </tr>
        	<tr>
				<td>&nbsp;  </td>
				<td> <input type="submit" value=" Sửa "  name="Submit" /> <input type="button" value=" Quay lại " onClick="location='?go=thongtingiaovien&action=view&page=1' ;"/></td>
			</tr>
		</table>
		
</form>
        <?
	}
	echo "</div>";

		?>
<div class="clear"></div>
</div>